﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
using System.Collections.ObjectModel;
using MediaArtAggregator.Core.Configuration;

namespace MediaArtAggregator.Core.SearchProvider {
  [XmlRoot("source")]
  public abstract class SearchSource {

    public event EventHandler SearchComplete;
    public event EventHandler SearcInitialize;

    public SearchSource ( ) {
      this.Results = new Collection<Uri> ( );
    }

    [XmlIgnore]
    public Collection<Uri> Results { get; private set; }

    protected virtual void OnSearchComplete ( EventArgs e ) {
      if ( this.SearchComplete != null )
        this.SearchComplete ( this, e );
    }

    protected virtual void OnSearchInitialize ( EventArgs e ) {
      this.Results.Clear ( );
      if ( this.SearcInitialize != null )
        this.SearcInitialize ( this, e );
    }

    public abstract void Search ( string search, Settings settings, SearchType searchType );
  }
}
